package kr.hkit.powerjava.chapter06.assign_if;

public class Four {

	private double height, weight, kaup;
	private int ages;
	private String condition;

	

	public Four(double height, double weight, int ages) {
		//super();
		this.height = height;
		this.weight = weight;
		this.ages = ages;
	}



	public String getCondition() {
		return condition;
	}



	String calKaup() {
		kaup = weight / height * height;

		if(ages >= 20 && ages < 30){
			if(kaup < 18)
				condition = "저체중";
			else if(kaup < 24)
				condition = "표준체중";
			else if(kaup < 31)
				condition = "과체중";
			else
				condition = "비만";
		}
			
		if(ages >= 30 && ages < 40){
			if(kaup < 18.5)
				condition = "저체중";
			else if(kaup < 25)
				condition = "표준체중";
			else if(kaup < 31)
				condition = "과체중";
			else
				condition = "비만";
		}
			
		return condition;		
	}



	@Override
	public String toString() {
		return "Four [카우프 지수에 의한 비만도는 " + calKaup() + "으로 나옴]";
	}
}
